/******************************************************************************
 * @Filename     : usci.h
 *
 * @Version      : V1.0
 * @Subversion   : $
 * @Last modified: 04/13/2020 16:01:41
 * @Modified by  : Mxy
 *
 * @Brief        : USCI driver header file
 *
 * Copyright (C) 2020 SKYRELAY Technology co.,Ltd All rights reserved.
 *****************************************************************************/
#ifndef __RC2412_USCI_DEF_H__
#define __RC2412_USCI_DEF_H__
//#include "udk.h"

#ifdef __cplusplus
extern "C"
{
#endif

#include "../Device/SkyRelay/RC2412/Include/rc2412.h"


//usci work mode, uart/spi/u7816
#define USCI_WORK_MODE_SPI             0x00ul
#define USCI_WORK_MODE_UART            0x01ul
#define USCI_WORK_MODE_U7816           0x02ul
	
//uart config	
#define USCI_UART_STOP_BIT_1           0x00ul
#define USCI_UART_STOP_BIT_2           0x01ul
#define USCI_UART_PAR_TYP_EVEN         0x00ul
#define USCI_UART_PAR_TYP_ODD          0x01ul
#define USCI_UART_PAR_EN_OFF           0x00ul
#define USCI_UART_PAR_EN_ON            0x01ul
#define USCI_UART_LSB_MSB              0x00ul
#define USCI_UART_LSB_LSB              0x01ul
#define USCI_UART_DATA_LEN_7BIT        0x00ul
#define USCI_UART_DATA_LEN_8BIT        0x01ul		
#define USCI_UART_DATA_LEN_9BIT        0x02ul
#define USCI_UART_DATA_WIDTH           (16)	
	
//spi config
#define USCI_SPI_WORK_MODE_MASTER      0x00ul
#define USCI_SPI_WORK_MODE_SLAVE       0x01ul
#define USCI_SPI_CLKP_IDLE_LOW         0x00ul
#define USCI_SPI_CLKP_IDLE_HIGH        0x01ul
#define USCI_SPI_TRX_NEG_POSEDGE       0x00ul
#define USCI_SPI_TRX_NEG_NEGEDGE       0x01ul
#define USCI_SPI_LSB_MSB               0x00ul
#define USCI_SPI_LSB_LSB               0x01ul	
#define USCI_SPI_DATA_LEN_7BIT         0x00ul
#define USCI_SPI_DATA_LEN_8BIT         0x01ul		
#define USCI_SPI_DATA_LEN_9BIT         0x02ul
#define USCI_SPI_SLAVE_CS_LEVEL_LOW    0x00ul
#define USCI_SPI_SLAVE_CS_LEVEL_HIGH   0x01ul	
#define USCI_SPI_DUMMY_DATA            0xFF

//u7816 config
#define USCI_U7816_STOP_BIT_1          0x00ul
#define USCI_U7816_STOP_BIT_2          0x01ul
#define USCI_U7816_PAR_TYP_EVEN        0x00ul
#define USCI_U7816_PAR_TYP_ODD         0x01ul
#define USCI_U7816_PAR_EN_OFF          0x00ul
#define USCI_U7816_PAR_EN_ON           0x01ul
#define USCI_U7816_LSB_MSB             0x00ul
#define USCI_U7816_LSB_LSB             0x01ul
#define USCI_U7816_DATA_LEN_7BIT       0x00ul
#define USCI_U7816_DATA_LEN_8BIT       0x01ul
#define USCI_U7816_DATA_LEN_9BIT       0x02ul		
#define USCI_U7816_BIT_INVERT_NO       0x00ul
#define USCI_U7816_BIT_INVERT          0x01ul

#define USCI_U7816_TRX_EN_MSK          0x00000003ul
#define USCI_U7816_BAUD_DEFAULT        (372*2 - 1)
#define USCI_U7816_BAUD_HIGH_SPEED     (32*2 -1)

#define USCI_U7816_CMD_CLK_ON          0x5A001AA5
#define USCI_U7816_CMD_CLK_OFF         0x5A0019A5


#ifdef __cplusplus
}
#endif
	
	
#endif

	
